package com.imau.servlet;

import javax.servlet.*;
import javax.servlet.annotation.WebServlet;
import java.io.IOException;

@WebServlet(urlPatterns = "/servletDemo1",loadOnStartup = 1)
public class ServletDemo1 implements Servlet {
    /**资源初始化1次*/
    public void init(ServletConfig servletConfig) throws ServletException {

        System.out.println("init....");
    }

    public ServletConfig getServletConfig() {
        System.out.println("ServletConfig....");
        return null;
    }

    /**处理请求，每次请求都执行*/
    public void service(ServletRequest servletRequest, ServletResponse servletResponse) throws ServletException, IOException {
        System.out.println("service....");
    }

    /**信息*/
    public String getServletInfo() {
        System.out.println("getServletInfo....");
        return null;
    }
    /**资源释放1次*/
    public void destroy() {
        System.out.println("destroy....");
    }
}
